import miniupnpc
c = miniupnpc.UPnP()
print(c.discover())
print(c.selectigd())
c.addportmapping(9999, 'TCP', c.lanaddr, 9999, 'miniupnpc', '')
p = c.getspecificportmapping(9999,'TCP')
while True:
    print(p)
    x=input('Enter "q" to quit')
    if x=='q':
        break
c.deleteportmapping(9999,'TCP')
